package com.test.learnkotlin.bean

data class Person(var name: String, var id: Int = 1000, val age: Int = 20, var address: String? = null) {

    override fun toString(): String {
        return "Person(name='$name', id=$id, age=$age, address=$address)"
    }
}

data class Person1(val name: String) {
    var age: Int = 0
}

fun main(){
    val person1 = Person1("John")
    val person2 = Person1("John")
    person1.age = 10
    person2.age = 20
    println("person1 == person2 结果：${person1 == person2}")
    println("person1.equals(person2) 结果：${person1.equals(person2)}")
}
